
from .task_gen import gen_task_spec
from .cfg_parser import parse_cfg
import tomli

if __name__ == "__main__":
    from pprint import pprint
    # pase toml to dict:
    with open('./cfg.toml', 'rb') as f:
        cfg_raw = tomli.load(f)
    cfg = parse_cfg(cfg_raw)
    pprint(cfg)
    root_tasks, task_specs, dependent_files = gen_task_spec(cfg, ['train_unsupervised'])
    print()
    # print(root_tasks)
    for task in task_specs.values():
        print(task.model_dump_json())
    print(dependent_files)